package org.codefinger.dao.impl.sql;

import org.codefinger.dao.impl.SQLVisitor;
import org.codefinger.dao.util.Lang;

public class DefaultSource implements Source {

	private String	text;

	public DefaultSource(String table) {
		super();
		this.text = Lang.joinStr(table.length() + 6," FROM ", table);
	}

	public DefaultSource(String table, String alias) {
		super();
		this.text = Lang.joinStr(table.length() + alias.length() + 7," FROM ", table, " ", alias);
	}

	@Override
	public void visit(SQLVisitor visitor) {
		visitor.appendSQL(text);
	}

}
